home *** CD-ROM | disk | FTP | other *** search
- Date: Mon, 18 Oct 93 09:59:44 -0700
- From: ersmith@netcom.com (Eric R. Smith)
- Message-Id: <9310181659.AA14044@netcom2.netcom.com>
- To: itschere@techfak.uni-bielefeld.de, mint@atari.archive.umich.edu
- Subject: Re: pipes & ptys
-
- Fselect() provides a way to sleep for less than 1 second (to sleep for n
- milliseconds, do Fselect(n, 0L, 0L, 0L)).
-
- The other thing you can do to speed up pipe I/O is to always try to
- Fread() and process more than 1 byte at a time. Usually there will be more
- than 1 byte written into the pipe at once (e.g. in a window system the
- caller will write a window command and some arguments all in one block).
- If you have the flags set appropriately,
- r = Fread(pipefd, bufsiz, buffer);
- will read either "bufsiz" bytes, or as many as are available, whichever
- is smaller. This can be a very big win. If you're only reading 1 byte
- at a time, then effectively the entire system gets slowed down to 1 character
- at a time I/O (since even if a program tries to write 4K bytes at once, only
- 1 character will typically manage to get into the pipe buffer at a time).
-
- Regards,
- Eric
-